<!-- 更多面板 -->

<template>
  <div v-if="infoVisible" class="MorePanel">
    <BtnText img="@/assets/img/back.png" title="返回" @click="closeInfo" />

    <Door v-if="infoType === 'door'" />

    <Park v-if="infoType === 'park'" />

    <Alarm v-if="infoType === 'alarm'" />
  </div>
</template>

<script>
// ============================== 导入依赖 ============================== //

import CORE from '@/CORE'

// ============================== 导出组件 ============================== //

export default {
  /**
   * 名称定义 (实际使用名称)
   */
  name: 'MorePanel',

  /**
   * 混入列表 (配置选项合并)
   */
  mixins: [CORE.mixScreen()],

  /**
   * 组件导入 (Abc.vue + Abc/index.vue)
   */
  ...CORE.components(require.context('./', true, /vue$/)),

  /**
   * 计算属性 (慎用箭头函数)
   */
  computed: {
    /**
     * 返回图片
     */
    backImg: () => require('@screen/assets/img/back.png'),
  },

  /**
   * 销毁之前 (先抽取再调用)
   */
  beforeDestroy() {
    this.closeInfo()
  },
}
</script>

<style lang="scss">
@import './index.scss';
</style>
